package com.sptpc.androidclass1021;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.IntentFilter;

public class Student extends MyBroadcastReceiver {
    Context stuContext;
    BroadcastReceiver stuBR;
    public Student(Context c, BroadcastReceiver br) {
        stuContext = c;
        stuBR = br;
        registerBCR();
    }

    private void registerBCR() {
        IntentFilter filter = new IntentFilter();
        filter.addAction("Exam");//过滤器 匹配 Teacher 的 "Exam"
        stuContext.registerReceiver(stuBR, filter);//绑定接收器和过滤器
        //注册
    }
}
